package com.huawei.gamebox.service.welfare.gift.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.service.common.cardkit.card.BaseGsCard;
import com.huawei.gamebox.service.welfare.gift.bean.CombineGameGiftListCardBean;
import com.huawei.gamebox.service.welfare.gift.bean.GameGiftHorizonScrollCardBean;
import o.cgz;
import o.chy;
import o.dof;
import o.exp.d;

public class CombineGameGiftListCard extends BaseGiftCard {
    private chy ˊ;
    private TextView ˎ;
    private ImageView ˏ;

    public /* synthetic */ cgz ˏ(View view) {
        return ˋ(view);
    }

    public CombineGameGiftListCard(Context context) {
        super(context);
    }

    public BaseGsCard ˋ(View view) {
        ˏ((TextView) view.findViewById(d.ᶥ));
        ॱ((ImageView) view.findViewById(d.ㆍ));
        this.ʿ = (TextView) view.findViewById(d.ꜞ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        int size;
        super.ˏ(cardBean);
        this.ˊᐝ = cardBean;
        CombineGameGiftListCardBean combineGameGiftListCardBean = (CombineGameGiftListCardBean) cardBean;
        if (dof.ʽ(combineGameGiftListCardBean.v_())) {
            this.ʿ.setVisibility(4);
        } else {
            this.ʿ.setVisibility(0);
            this.ʿ.setText(combineGameGiftListCardBean.v_());
        }
        if (dof.ʽ(combineGameGiftListCardBean.ॱॱ())) {
            ˊ().setVisibility(4);
            ʻ().setVisibility(4);
        } else {
            ˊ().setVisibility(0);
            ˊ().setTag(combineGameGiftListCardBean);
            ʻ().setVisibility(0);
            ʻ().setTag(combineGameGiftListCardBean);
        }
        if (combineGameGiftListCardBean.ˊ() != null) {
            size = combineGameGiftListCardBean.ˊ().size();
        } else {
            size = 0;
        }
        int ˋ = ˋ();
        for (int i = 0; i < ˋ; i++) {
            BaseGsCard ˊ = ˊ(i);
            if (ˊ instanceof GameGiftHorizonScrollCard) {
                GameGiftHorizonScrollCard gameGiftHorizonScrollCard = (GameGiftHorizonScrollCard) ˊ;
                if (i >= size) {
                    gameGiftHorizonScrollCard.ˉ().setVisibility(8);
                } else {
                    gameGiftHorizonScrollCard.ˉ().setVisibility(0);
                    CardBean cardBean2 = (GameGiftHorizonScrollCardBean) combineGameGiftListCardBean.ˊ().get(i);
                    cardBean2.ˋˋ(combineGameGiftListCardBean.ॱˉ());
                    gameGiftHorizonScrollCard.ˏ(cardBean2);
                }
            }
        }
    }

    public TextView ˊ() {
        return this.ˎ;
    }

    private void ˏ(TextView textView) {
        this.ˎ = textView;
    }

    public ImageView ʻ() {
        return this.ˏ;
    }

    private void ॱ(ImageView imageView) {
        this.ˏ = imageView;
    }

    public void ˏ(chy o_chy) {
        this.ˊ = o_chy;
    }
}
